<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>中间公共部分</title>
    <link rel="stylesheet" href="../../css/reset.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1516407_fx9en0nm4fw.css">
    <style>
        .setContect {
            width: 150px;
            border: 1px solid #e7e7e7;
            font-size: 14px;
            color: #a9a9a9;
            overflow: hidden;
        }

        .setContect li {
            padding-left: 20px;
            line-height: 30px;
        }

        .setContect .self {
            width: 100%;
            height: 45px;
            font-size: 17px;
            color: #747474;
            line-height: 45px;
            border-bottom: 1px solid #e9e9e9;

        }

        .setContect .setLi span {
            font-size: 15px;
            color: #666666;
        }
       
        .setContect .setLi ul li{
            padding-left:0px;
            font-size: 14px;
            color: #a9a9a9;
        }
        .setContect .liSpan {
            font-size: 12px;
            margin-left: 10px;
        }
    
    </style>
</head>

<body>
    <div id="serMain">
        <ul class="setContect">
            <li class="self">个人中心</li>
            <li class="setLi" onOff = "true">
                <span>交易管理</span>
                <span class=" icon iconfont icon-arrow-bottom liSpan"></span>
                <ul>
                    <li >我的账户</li>
                    <li >我的订单</li>
                    <li >我的积分</li>
                    <li >积分订单</li>
                    <li >我的钱包</li>
                </ul>
            </li>

            <li class="setLi" onOff = "true">
                <span>会员资料 </span>
                <span class=" icon iconfont icon-arrow-bottom liSpan"></span>
                <ul>
                    <li>个人资料</li>
                    <li> 地址管理</li>
                    <li> 我的收藏</li>
                    <li> 最近浏览</li>
                    <li> 修改密码</li>
                </ul>
            </li>

            <li id="setLi" class="setLi" onOff = "true">
                <span>站内信 </span>
                <span class=" icon iconfont icon-arrow-bottom liSpan"></span>
                <ul>
                    <li> 我的消息</li>
                    <li> 意见反馈</li>
                </ul>
            </li>

        </ul>
    </div>
</body>
<script src="../../js/jquery-3.4.1.js"></script>
<script>
    
    
    $(".liSpan").click(function () {

        // console.log($(this).attr("onOff"))
        console.log($(this).parent().attr("onOff"))
        if($(this).parent().attr("onOff")== "true"){
            $(this).parent().children("ul").css("display","none");
            $(this).parent().attr("onOff","false")
        }else{
            $(this).parent().children("ul").css("display","block");
            $(this).parent().attr("onOff","true")
        }
        
    })
</script>

</html>